<?php
/**
 * Nweb Framework
 *
 * This script is protected by copyright. It's use, copying, modification
 * and distribution without written consent of the author is prohibited.
 *
 * @category    source
 * @package     pl.nweb.framework.application.router
 * @author      Krzysztof Kardasz <krzysztof.kardasz@gmail.com>
 * @copyright   Copyright (c) 2011 Krzysztof Kardasz
 * @license     http://www.gnu.org/licenses/lgpl-3.0.txt  GNU Lesser General Public
 * @version     3.0 $Id$
 * @link        http://code.google.com/p/nweb-framework/
 * @link        http://framework.nweb.pl
 */

namespace pl\nweb\framework\application\router;

/**
 * Trasa
 *
 * @category    source
 * @package     pl.nweb.framework.application.router
 * @author      Krzysztof Kardasz <krzysztof.kardasz@gmail.com>
 * @copyright   Copyright (c) 2011 Krzysztof Kardasz
 * @version     3.0 $Id$
 */
abstract class Route
{
    /**
     * Nazwa trasy
     *
     * @var string
     */
    private $_name = 'default';

    /**
     * Definiuje nazwę trasy
     *
     * @param string $name nazwa
     * @return void
     */
    public function setName($name)
    {
        $this->_name = $name;
    }

    /**
     * Zwraca nazwę trasy
     *
     * @return string
     */
    public function getName()
    {
        return $this->_name;
    }

    /**
     * Dopasowanie trasy
     *
     * @param string $url adres url
     * @return false|array
     */
    abstract public function match($url);

    /**
     * Generowanie adresu url
     *
     * @param array $params parametry
     * @param array $query zapytanie (uri query string)
     * @return string
     */
    abstract public function url(array $params = array(), array $query = array());
}